/**
 * Created by kangli on 2018/3/7.
 */
function login(){
    var  name = $(".manaAccount").val();
    var  pass = $(".manaPass").val();
    var question =(name!=""&&name!=undefined&& name!= null)? pass!=""&&pass!=undefined&& pass!= null?
        "UMtrue":alert("密码不为空") :alert("账号不为空");
    if(question=='UMtrue'){
        var data = '{"username":"' + name + '","password":"' + pass + '"}';
        AjaxSubmit("POST",JSON.parse(data),basePath + "/loginUser",loginUser_fun);
    }

}

function loginUser_fun(res){
    console.log(res);
    if(res=='1001'){
        alert("账号不存在")
    }else  if(res=='1002'){
        alert("密码错误")
    }else  if(res=='1003'){
        alert("无权限访问")
    }else if(res=='1000'){
         sessionStorage.setItem("account",$(".manaAccount").val());
         self.location.href='html/index.html';
    }
}